** Figure A9
clear all
set more off 
capture log close
 
* main path to data
global path "~/Dropbox/Paraguay/1_data/7_replication_dataverse"
capture cd "$path"	

*tables = analysis tables
global figures "$path/figures"

* load rural collective action data
use "$path/data/landinv.dta", clear


// Generate indicator variables for years 
forval year = 1954/2007 {
    generate y`year' = (year == `year')
}

// Generate the alt_1989 variable and set it to 0
generate alt_1988 = 0


** figure A9.a

set more off
eststo clear

reg l_linv  c.betweenness_z  y1955#c.betweenness_z ///
			y1956#c.betweenness_z y1957#c.betweenness_z y1958#c.betweenness_z y1959#c.betweenness_z y1960#c.betweenness_z ///
			y1961#c.betweenness_z y1962#c.betweenness_z y1963#c.betweenness_z y1964#c.betweenness_z y1965#c.betweenness_z ///
			y1966#c.betweenness_z y1967#c.betweenness_z y1968#c.betweenness_z y1969#c.betweenness_z y1970#c.betweenness_z ///
			y1971#c.betweenness_z y1972#c.betweenness_z y1973#c.betweenness_z y1974#c.betweenness_z y1975#c.betweenness_z ///
			y1976#c.betweenness_z y1977#c.betweenness_z y1978#c.betweenness_z y1979#c.betweenness_z y1980#c.betweenness_z ///
			y1981#c.betweenness_z y1982#c.betweenness_z y1983#c.betweenness_z y1984#c.betweenness_z y1985#c.betweenness_z ///
			y1986#c.betweenness_z y1987#c.betweenness_z alt_1988 y1989#c.betweenness_z y1990#c.betweenness_z ///
			y1991#c.betweenness_z y1992#c.betweenness_z y1993#c.betweenness_z y1994#c.betweenness_z y1995#c.betweenness_z ///
			y1996#c.betweenness_z y1997#c.betweenness_z y1998#c.betweenness_z y1999#c.betweenness_z y2000#c.betweenness_z ///
			y2001#c.betweenness_z y2002#c.betweenness_z y2003#c.betweenness_z y2004#c.betweenness_z y2005#c.betweenness_z ///
			y2006#c.betweenness_z y2007#c.betweenness_z ///
			i.year i.district_code  i.year##i.depa ,  cluster(district_code)




set scheme s1mono
coefplot, vertical omitted keep( 1.y1983#c.betweenness_z 1.y1984#c.betweenness_z 1.y1985#c.betweenness_z ///
			1.y1986#c.betweenness_z 1.y1987#c.betweenness_z  alt_1988  1.y1989#c.betweenness_z ///
			1.y1990#c.betweenness_z 1.y1991#c.betweenness_z 1.y1992#c.betweenness_z 1.y1993#c.betweenness_z ///
			1.y1994#c.betweenness_z 1.y1995#c.betweenness_z) xlabel( 1 "1983" 2 "1984" 3  "1985" ///
			4 "1986" 5 "1987"  6 "1988" 7 "1989" 8 "1990" ///
			9 "1991" 10 "1992" 11 "1993" 12 "1994" 13 "1995") ///
          yline(0, lcolor(red)) ///
          xtitle("Year", size(3.7) margin(small))  ///
          ytitle("Effect relative to 1988", size(3.7) margin(small))  ///   
          ciopts(recast(rcap)) ///
          xline(6, lpattern(dash))
				
graph export "$figures/figureA9a.pdf", replace



** figure A9.b



set more off
eststo clear

reg linv_b  c.betweenness_z  y1955#c.betweenness_z ///
			y1956#c.betweenness_z y1957#c.betweenness_z y1958#c.betweenness_z y1959#c.betweenness_z y1960#c.betweenness_z ///
			y1961#c.betweenness_z y1962#c.betweenness_z y1963#c.betweenness_z y1964#c.betweenness_z y1965#c.betweenness_z ///
			y1966#c.betweenness_z y1967#c.betweenness_z y1968#c.betweenness_z y1969#c.betweenness_z y1970#c.betweenness_z ///
			y1971#c.betweenness_z y1972#c.betweenness_z y1973#c.betweenness_z y1974#c.betweenness_z y1975#c.betweenness_z ///
			y1976#c.betweenness_z y1977#c.betweenness_z y1978#c.betweenness_z y1979#c.betweenness_z y1980#c.betweenness_z ///
			y1981#c.betweenness_z y1982#c.betweenness_z y1983#c.betweenness_z y1984#c.betweenness_z y1985#c.betweenness_z ///
			y1986#c.betweenness_z y1987#c.betweenness_z alt_1988 y1989#c.betweenness_z y1990#c.betweenness_z ///
			y1991#c.betweenness_z y1992#c.betweenness_z y1993#c.betweenness_z y1994#c.betweenness_z y1995#c.betweenness_z ///
			y1996#c.betweenness_z y1997#c.betweenness_z y1998#c.betweenness_z y1999#c.betweenness_z y2000#c.betweenness_z ///
			y2001#c.betweenness_z y2002#c.betweenness_z y2003#c.betweenness_z y2004#c.betweenness_z y2005#c.betweenness_z ///
			y2006#c.betweenness_z y2007#c.betweenness_z ///
			i.year i.district_code  i.year##i.depa ,  cluster(district_code)



coefplot, vertical omitted keep( 1.y1983#c.betweenness_z 1.y1984#c.betweenness_z 1.y1985#c.betweenness_z ///
			1.y1986#c.betweenness_z 1.y1987#c.betweenness_z  alt_1988  1.y1989#c.betweenness_z ///
			1.y1990#c.betweenness_z 1.y1991#c.betweenness_z 1.y1992#c.betweenness_z 1.y1993#c.betweenness_z ///
			1.y1994#c.betweenness_z 1.y1995#c.betweenness_z) xlabel( 1 "1983" 2 "1984" 3  "1985" ///
			4 "1986" 5 "1987"  6 "1988" 7 "1989" 8 "1990" ///
			9 "1991" 10 "1992" 11 "1993" 12 "1994" 13 "1995") ///
          yline(0, lcolor(red)) ///
          xtitle("Year", size(3.7) margin(small))  ///
          ytitle("Effect relative to 1988", size(3.7) margin(small))  ///   
          ciopts(recast(rcap)) ///
          xline(6, lpattern(dash))

graph export "$figures/figureA9b.pdf", replace



** figure A9.c


set more off
eststo clear

reg l_peasfam c.betweenness_z  y1955#c.betweenness_z ///
			y1956#c.betweenness_z y1957#c.betweenness_z y1958#c.betweenness_z y1959#c.betweenness_z y1960#c.betweenness_z ///
			y1961#c.betweenness_z y1962#c.betweenness_z y1963#c.betweenness_z y1964#c.betweenness_z y1965#c.betweenness_z ///
			y1966#c.betweenness_z y1967#c.betweenness_z y1968#c.betweenness_z y1969#c.betweenness_z y1970#c.betweenness_z ///
			y1971#c.betweenness_z y1972#c.betweenness_z y1973#c.betweenness_z y1974#c.betweenness_z y1975#c.betweenness_z ///
			y1976#c.betweenness_z y1977#c.betweenness_z y1978#c.betweenness_z y1979#c.betweenness_z y1980#c.betweenness_z ///
			y1981#c.betweenness_z y1982#c.betweenness_z y1983#c.betweenness_z y1984#c.betweenness_z y1985#c.betweenness_z ///
			y1986#c.betweenness_z y1987#c.betweenness_z alt_1988 y1989#c.betweenness_z y1990#c.betweenness_z ///
			y1991#c.betweenness_z y1992#c.betweenness_z y1993#c.betweenness_z y1994#c.betweenness_z y1995#c.betweenness_z ///
			y1996#c.betweenness_z y1997#c.betweenness_z y1998#c.betweenness_z y1999#c.betweenness_z y2000#c.betweenness_z ///
			y2001#c.betweenness_z y2002#c.betweenness_z y2003#c.betweenness_z y2004#c.betweenness_z y2005#c.betweenness_z ///
			y2006#c.betweenness_z y2007#c.betweenness_z ///
			i.year i.district_code  i.year##i.depa ,  cluster(district_code)



coefplot, vertical omitted keep( 1.y1983#c.betweenness_z 1.y1984#c.betweenness_z 1.y1985#c.betweenness_z ///
			1.y1986#c.betweenness_z 1.y1987#c.betweenness_z  alt_1988  1.y1989#c.betweenness_z ///
			1.y1990#c.betweenness_z 1.y1991#c.betweenness_z 1.y1992#c.betweenness_z 1.y1993#c.betweenness_z ///
			1.y1994#c.betweenness_z 1.y1995#c.betweenness_z) xlabel( 1 "1983" 2 "1984" 3  "1985" ///
			4 "1986" 5 "1987"  6 "1988" 7 "1989" 8 "1990" ///
			9 "1991" 10 "1992" 11 "1993" 12 "1994" 13 "1995") ///
          yline(0, lcolor(red)) ///
          xtitle("Year", size(3.7) margin(small))  ///
          ytitle("Effect relative to 1988", size(3.7) margin(small))  ///   
          ciopts(recast(rcap)) ///
          xline(6, lpattern(dash))

graph export "$figures/figureA9c.pdf", replace




** figure A9.d


set more off
eststo clear

reg l_hectares   c.betweenness_z  y1955#c.betweenness_z ///
			y1956#c.betweenness_z y1957#c.betweenness_z y1958#c.betweenness_z y1959#c.betweenness_z y1960#c.betweenness_z ///
			y1961#c.betweenness_z y1962#c.betweenness_z y1963#c.betweenness_z y1964#c.betweenness_z y1965#c.betweenness_z ///
			y1966#c.betweenness_z y1967#c.betweenness_z y1968#c.betweenness_z y1969#c.betweenness_z y1970#c.betweenness_z ///
			y1971#c.betweenness_z y1972#c.betweenness_z y1973#c.betweenness_z y1974#c.betweenness_z y1975#c.betweenness_z ///
			y1976#c.betweenness_z y1977#c.betweenness_z y1978#c.betweenness_z y1979#c.betweenness_z y1980#c.betweenness_z ///
			y1981#c.betweenness_z y1982#c.betweenness_z y1983#c.betweenness_z y1984#c.betweenness_z y1985#c.betweenness_z ///
			y1986#c.betweenness_z y1987#c.betweenness_z alt_1988 y1989#c.betweenness_z y1990#c.betweenness_z ///
			y1991#c.betweenness_z y1992#c.betweenness_z y1993#c.betweenness_z y1994#c.betweenness_z y1995#c.betweenness_z ///
			y1996#c.betweenness_z y1997#c.betweenness_z y1998#c.betweenness_z y1999#c.betweenness_z y2000#c.betweenness_z ///
			y2001#c.betweenness_z y2002#c.betweenness_z y2003#c.betweenness_z y2004#c.betweenness_z y2005#c.betweenness_z ///
			y2006#c.betweenness_z y2007#c.betweenness_z ///
			i.year i.district_code  i.year##i.depa ,  cluster(district_code)





coefplot, vertical omitted keep( 1.y1983#c.betweenness_z 1.y1984#c.betweenness_z 1.y1985#c.betweenness_z ///
			1.y1986#c.betweenness_z 1.y1987#c.betweenness_z  alt_1988  1.y1989#c.betweenness_z ///
			1.y1990#c.betweenness_z 1.y1991#c.betweenness_z 1.y1992#c.betweenness_z 1.y1993#c.betweenness_z ///
			1.y1994#c.betweenness_z 1.y1995#c.betweenness_z) xlabel( 1 "1983" 2 "1984" 3  "1985" ///
			4 "1986" 5 "1987"  6 "1988" 7 "1989" 8 "1990" ///
			9 "1991" 10 "1992" 11 "1993" 12 "1994" 13 "1995") ///
          yline(0, lcolor(red)) ///
          xtitle("Year", size(3.7) margin(small))  ///
          ytitle("Effect relative to 1988", size(3.7) margin(small))  ///   
          ciopts(recast(rcap)) ///
          xline(6, lpattern(dash))
			
graph export "$figures/figureA9d.pdf", replace
